import java.util.Arrays;
import java.util.Locale;

public class TestDemo {


    public static void main(String[] args) {
        String str = "hello";
        String str2 = "hello";
        System.out.println(str == str2);
    }








    public static void main8(String[] args) {
        String str = "   ahgsj kgh      r       ";
        System.out.println(str);

        String str2 = str.trim();
        System.out.println(str2);
        /*String ret = str.substring(1,8);
        System.out.println(ret);*/
    }


    public static void main7(String[] args) {
        String str = "name=zhangsan&age=18" ;
        String[] strings = str.split("&");
        for (String x : strings) {
            String[] strings1 = x.split("=");
            for (String x2 : strings1) {
                System.out.println(x2);
            }
        }
    }

    public static void main6(String[] args) {
        String str = "192-168-1-1";
        String[] strings = str.split("-");
        for (String s : strings) {
            System.out.println(s);
        }
    }



    public static void main5(String[] args) {

        String str = "asdfgasdasdasdhjk";
        //String ret = str.replace("as","pp");
        //String ret = str.replaceFirst("as","uu");
        //String ret = str.replaceAll("as","uu");

        String ret = str.replace('a','g');
        System.out.println(ret);
    }


    public static void main4(String[] args) {
        String str = "asdfgasdasdasdhjk";
        char[] ch = str.toCharArray();

        System.out.println(Arrays.toString(ch));



        System.out.println(str.indexOf("sd",1));
        System.out.println(str.lastIndexOf("asd"));

        System.out.println(str.toUpperCase());
        System.out.println(str.toLowerCase());

        String s = String.format("%d-%d-%d",2019,9,14);
        System.out.println(s);
    }



    public static void main3(String[] args) {
        String str = "afdsg";
        //char ch = str.charAt(5);
        //System.out.println(ch);
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            System.out.println(ch);
        }
    }

    public static void main2(String[] args) {
        String str = "hello";
        System.out.println(str);

        String str2 = new String("hello");

        System.out.println(str == str2);


        System.out.println(str.equals(str2));
        System.out.println("afasa".equals(str2));
        String str3 = null;
        System.out.println(str2.equals(str3));


        System.out.println(str.compareTo(str2));
        System.out.println(str.compareToIgnoreCase(str2));
    }




    public static void main1(String[] args) {
        String str = "hello";
        String str2 = new String("hello");
        int[] array = {1,2,3};
        int[] array2 = new int[]{1,2,3};
    }






}
